﻿using Microsoft.Extensions.DependencyInjection;

namespace _04_IOC
{
    public interface ILogger<T>
    {
        void Log();
    }
    [Injection(ServiceType = typeof(ILogger<>), Lifetime = ServiceLifetime.Transient)]
    internal class Logger<T> : ILogger<T>, IDisposable
    {
        public void Dispose()
        {
            Console.WriteLine("释放了...");
        }

        public void Log()
        {
            Console.WriteLine(typeof(T).Name + "：success！");
        }
    }
}
